package JSE_02.Map.Demo02;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
import java.util.Set;

public class Demo02 {
    public static void main(String[] args){
        show_00();
    }

    public static void show_00(){
        Map<String,Integer> map=new HashMap<>();
        map.put("赵丽颖",168);
        map.put("杨颖",165);
        map.put("林志玲",178);

        Set<String> set=map.keySet(); // 这个方法就是把map的key放到set集合里
        Iterator<String> it=set.iterator();
        while(it.hasNext()){
            System.out.println(map.get(it.next()));
        }
        System.out.println("===============");

        for(String name:set){
            System.out.println(map.get(name));
        }
    }
}
